# !usr/bin/env python
# -*- coding:utf-8 _*-
"""
@Author:张广勤
@Web site: https://www.tunan.wang
@Github:www.github.com
 
@File:mianma1_0.py
@Time:2024/12/9 21:43

@Motto:不积跬步无以至千里，不积小流无以成江海！
"""

import requests
import chardet

# 获取网页内容
response = requests.get('https://tv.cctv.com/2024/08/12/VIDErZqdFjEythsEdjru1twd240812.shtml')
html_content = response.content

# 检测编码
result = chardet.detect(html_content)
print(result['encoding'])  # 输出检测到的编码